<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=utf-8"  pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>自动售货机</title>
<%String mid = request.getParameter("mid");%>
<meta name="spider-id" content="o69xrz">

<meta name="viewport"content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
<meta content="telephone=no" name="format-detection">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<script type="text/javascript">!function(e,r){function t(e){return function(r){return{}.toString.call(r)=="[object "+e+"]"}}function n(){return T++}function a(e){return e.match(S)[0]}function i(e){for(e=e.replace(x,"/");e.match(N);)e=e.replace(N,"/");return e=e.replace(O,"$1/")}function s(e){var r=e.length-1,t=e.charAt(r);return"#"===t?e.substring(0,r):".js"===e.substring(r-2)||e.indexOf("?")>0||".css"===e.substring(r-3)||"/"===t?e:e+".js"}function o(e){var r=y.alias;return r&&A(r[e])?r[e]:e}function u(e){var r,t=y.paths;return t&&(r=e.match(U))&&A(t[r[1]])&&(e=t[r[1]]+r[2]),e}function c(e){var r=y.vars;return r&&e.indexOf("{")>-1&&(e=e.replace(q,function(e,t){return A(r[t])?r[t]:e})),e}function f(e){var r=y.map,t=e;if(r)for(var n=0,a=r.length;n<a;n++){var i=r[n];if((t=b(i)?i(e)||e:e.replace(i[0],i[1]))!==e)break}return t}function l(e,r){var t,n=e.charAt(0);if(C.test(e))t=e;else if("."===n)t=i((r?a(r):y.cwd)+e);else if("/"===n){var s=y.cwd.match(I);t=s?s[0]+e.substring(1):e}else t=y.base+e;return 0===t.indexOf("//")&&(t=location.protocol+t),t}function d(e,r,t,n){function a(){e.onload=e.onerror=e.onreadystatechange=null,t||y.debug||X.removeChild(e),e=null,r()}var i="onload"in e;!t||!V&&i?i?(e.onload=a,e.onerror=function(){w("error",{uri:n,node:e}),a()}):e.onreadystatechange=function(){/loaded|complete/.test(e.readyState)&&a()}:setTimeout(function(){v(e,r)},1)}function v(e,r){var t,n=e.sheet;if(V)n&&(t=!0);else if(n)try{n.cssRules&&(t=!0)}catch(e){"NS_ERROR_DOM_SECURITY_ERR"===e.name&&(t=!0)}setTimeout(function(){t?r():v(e,r)},20)}function p(){if($)return $;if(k&&"interactive"===k.readyState)return k;for(var e=X.getElementsByTagName("script"),r=e.length-1;r>=0;r--){var t=e[r];if("interactive"===t.readyState)return k=t}}function h(e){var r=[];return e.replace(M,"").replace(K,function(e,t,n){n&&r.push(n)}),r}function g(e,r){this.uri=e,this.dependencies=r||[],this.exports=null,this.status=0,this._waitings={},this._remain=0}if(!e.seajs){var E=e.seajs={version:"2.2.1"},y=E.data={},m=t("Object"),A=t("String"),_=Array.isArray||t("Array"),b=t("Function"),T=0,D=y.events={};E.on=function(e,r){return(D[e]||(D[e]=[])).push(r),E},E.off=function(e,r){if(!e&&!r)return D=y.events={},E;var t=D[e];if(t)if(r)for(var n=t.length-1;n>=0;n--)t[n]===r&&t.splice(n,1);else delete D[e];return E};var w=E.emit=function(e){var r,t=D[e];if(t){t=t.slice();for(var n=Array.prototype.slice.call(arguments,1);r=t.shift();)r.apply(null,n)}return E},S=/[^?#]*\//,x=/\/\.\//g,N=/\/[^/]+\/\.\.\//,O=/([^:/])\/\//g,U=/^([^/:]+)(\/.+)$/,q=/{([^{]+)}/g,C=/^\/\/.|:\//,I=/^.*?\/\/.*?\//,j=document,G=a(j.URL),R=j.scripts,L=a(function(e){return e.hasAttribute?e.src:e.getAttribute("src",4)}(j.getElementById("seajsnode")||R[R.length-1])||G);E.resolve=function(e,r){if(!e)return"";var t=l(e=s(e=c(e=u(e=o(e)))),r);return t=f(t)};var $,k,X=j.head||j.getElementsByTagName("head")[0]||j.documentElement,B=X.getElementsByTagName("base")[0],F=/\.css(?:\?|$)/i,V=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/(\d+).*/,"$1")<536;E.request=function(e,r,t){var n=F.test(e),a=j.createElement(n?"link":"script");if(t){var i=b(t)?t(e):t;i&&(a.charset=i)}d(a,r,n,e),n?(a.rel="stylesheet",a.href=e):(a.async=!0,a.src=e),$=a,B?X.insertBefore(a,B):X.appendChild(a),$=null};var H,K=/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|\/\*[\S\s]*?\*\/|\/(?:\\\/|[^\/\r\n])+\/(?=[^\/])|\/\/.*|\.\s*require|(?:^|[^$])\brequire\s*\(\s*(["'])(.+?)\1\s*\)/g,M=/\\\\/g,P=E.cache={},W={},Y={},z={},J=g.STATUS={FETCHING:1,SAVED:2,LOADING:3,LOADED:4,EXECUTING:5,EXECUTED:6};g.prototype.resolve=function(){for(var e=this,r=e.dependencies,t=[],n=0,a=r.length;n<a;n++)t[n]=g.resolve(r[n],e.uri);return t},g.prototype.load=function(){var e=this;if(!(e.status>=J.LOADING)){e.status=J.LOADING;var r=e.resolve();w("load",r,e);for(var t,n=e._remain=r.length,a=0;a<n;a++)(t=g.get(r[a])).status<J.LOADED?t._waitings[e.uri]=(t._waitings[e.uri]||0)+1:e._remain--;if(0!==e._remain){var i={};for(a=0;a<n;a++)(t=P[r[a]]).status<J.FETCHING?t.fetch(i):t.status===J.SAVED&&t.load();for(var s in i)i.hasOwnProperty(s)&&i[s]()}else e.onload()}},g.prototype.onload=function(){var e=this;e.status=J.LOADED,e.callback&&e.callback();var r,t,n=e._waitings;for(r in n)n.hasOwnProperty(r)&&((t=P[r])._remain-=n[r],0===t._remain&&t.onload());delete e._waitings,delete e._remain},g.prototype.fetch=function(e){function r(){E.request(a.requestUri,a.onRequest,a.charset)}var t=this,n=t.uri;t.status=J.FETCHING;var a={uri:n};w("fetch",a);var i=a.requestUri||n;i&&!Y[i]?W[i]?z[i].push(t):(W[i]=!0,z[i]=[t],w("request",a={uri:n,requestUri:i,onRequest:function(){delete W[i],Y[i]=!0,H&&(g.save(n,H),H=null);var e,r=z[i];for(delete z[i];e=r.shift();)e.load()},charset:y.charset}),a.requested||(e?e[a.requestUri]=r:r())):t.load()},g.prototype.exec=function(){function e(r){return g.get(e.resolve(r)).exec()}var r=this;if(r.status>=J.EXECUTING)return r.exports;r.status=J.EXECUTING;var t=r.uri;e.resolve=function(e){return g.resolve(e,t)},e.async=function(r,a){return g.use(r,a,t+"_async_"+n()),e};var a=r.factory,i=b(a)?a(e,r.exports={},r):a;return void 0===i&&(i=r.exports),delete r.factory,r.exports=i,r.status=J.EXECUTED,w("exec",r),i},g.resolve=function(e,r){var t={id:e,refUri:r};return w("resolve",t),t.uri||E.resolve(t.id,r)},g.define=function(e,r,t){var n=arguments.length;1===n?(t=e,e=void 0):2===n&&(t=r,_(e)?(r=e,e=void 0):r=void 0),!_(r)&&b(t)&&(r=h(t.toString()));var a={id:e,uri:g.resolve(e),deps:r,factory:t};if(!a.uri&&j.attachEvent){var i=p();i&&(a.uri=i.src)}w("define",a),a.uri?g.save(a.uri,a):H=a},g.save=function(e,r){var t=g.get(e);t.status<J.SAVED&&(t.id=r.id||e,t.dependencies=r.deps||[],t.factory=r.factory,t.status=J.SAVED)},g.get=function(e,r){return P[e]||(P[e]=new g(e,r))},g.use=function(r,t,n){var a=g.get(n,_(r)?r:[r]);a.callback=function(){for(var r=[],n=a.resolve(),i=0,s=n.length;i<s;i++)r[i]=P[n[i]].exec();t&&t.apply(e,r),delete a.callback},a.load()},g.preload=function(e){var r=y.preload,t=r.length;t?g.use(r,function(){r.splice(0,t),g.preload(e)},y.cwd+"_preload_"+n()):e()},E.use=function(e,r){return g.preload(function(){g.use(e,r,y.cwd+"_use_"+n())}),E},g.define.cmd={},e.define=g.define,E.Module=g,y.fetchedList=Y,y.cid=n,E.require=function(e){var r=g.get(g.resolve(e));return r.status<J.EXECUTING&&(r.onload(),r.exec()),r.exports};var Q=/^(.+?\/)(\?\?)?(seajs\/)+/;y.base=(L.match(Q)||["",L])[1],y.dir=L,y.cwd=G,y.charset="utf-8",y.preload=function(){var e=[],r=location.search.replace(/(seajs-\w+)(&|$)/g,"$1=1$2");return(r+=" "+j.cookie).replace(/(seajs-\w+)=1/g,function(r,t){e.push(t)}),e}(),E.config=function(e){for(var r in e){var t=e[r],n=y[r];if(n&&m(n))for(var a in t)n[a]=t[a];else _(n)?t=n.concat(t):"base"===r&&("/"!==t.slice(-1)&&(t+="/"),t=l(t)),y[r]=t}return w("config",e),E}}(this)</script>

<style type="text/css">
.cart {
	width: 60px;
	line-height: 20px;
	float: left;
	padding-left: 30px;
	margin-left: 80px;
	margin-bottom: 4px;	
  	border-right: 1px solid #d8d8d8;
	background: url(../image/common.gif) -210px -180px no-repeat;
	margin: 12px 12px 0 0;
    display: inline-block;
    float: right;
    font-size: 14px;
    height: 20px;
    color: #404040
}

</style>
</head>

<body style="max-width: 640px; font-size: 12px;">
	<link href="./index5_files/supermarket.min.827f444e.css" type="text/css" rel="stylesheet">

	<div class="head_nav"></div>
	<div id="index_cover" class="index_cover hide"></div>
	<div id="wd_show">
		<div id="common_hd" class="weidian_default" style="padding-left: 68px">
			<a id="common_hd_logo" class="t_hide abs common_hd_logo_noBack">微店</a>
			<a id="alliance_GO_logo" class="icon-global hide" href="javascript:void(0);"></a>
			<div class="my_shop for_gaq no-login active" data-for-gaq="点击我的微店;店铺页">
				<b>登录</b>
				<span></span>
			</div>
			<a class="icon-wei-points-btn for_gaq hide" data-for-gaq="点击查看我的微积分;详情页"
				href=""> 				
				<img id="user-logo" class="hide" src="">
				<span>积分<b class="flame"></b></span>
			</a>
		
			<div class="cart" style="float: right;">
				<a href="../MaiShopServlet?id=${1}">购物车</a>
			</div>								
			
		</div>

		<div class="headerxm">
			<div class="avatar">
				<img src="./index5_files/vshop1027968340-1490082514.jpg" alt="店铺头像">
			</div>
			<div class="custom-bar">
				<h2 class="shop-name">
					自动售货机
					<div class="">					
						<marquee>
							<p id="" style="animation-duration: 20s;">
								近期售货机出现问题管理员联系电话18947572326 有问题请咨询管理员
							</p>
						</marquee>
					</div>
				</h2>
			</div>
		</div>
		<!-- 限制一页显示几个商品  style="height: 500px;"-->
		<section class="content" id="shopClassList" style="height:90%;width:100%;">
			<!-- 商品类别区域 -->
			<div id="vtabScrollWrapper">				
				<ul class="vtab" id="vtab">
					<c:forEach items="${categoryBean}" var="li2">									
						<a href="${pageContext.request.contextPath}/CommodityListServlet?cid=${li2.id}&mid=<%=mid%>">
							<li>
								${li2.name}
							</li>
						</a>
					</c:forEach>
				</ul>				
			</div>
			
			<div class="loading vtab-content-loading" id="loading" style="display: none;"></div>
			<div  style="float: right;">
				<div  style="height: auto;">
				<c:forEach items="${commoditylist}" var="li3">
					<c:choose>
	   					<c:when test="${li3!=null}"> 												
								<a href="../CommodityServlet?id=${li3.id}" >
									<div class="vtab-item">
									<img src="../${li3.imgpath}" class="item-img">
									<div class="item-info clickfocus">
										<span class="item-title clickfocus">${li3.name}</span>
										<div class="item-price clickfocus">
											<span class="item-price-kill clickfocus">￥ ${li3.price}</span>
										</div>
										<div class="item-sold clickfocus">
											<c:choose>
		   										<c:when test="${li3.number>0}">  
		            								<span>剩余数量: ${li3.number}</span>
													<!-- 从购物车减去 &path=<%--request.getRequestURL()--%>?cid=<%--id--%> -->
													<a href="${pageContext.request.contextPath}/ReduceServlet?gid=${li3.id}&path=<%=request.getRequestURL()%>&mid=<%=mid%>">
														<span class="buy-icon buy-minus js_subtraction hide"></span>
													</a>
													<input type="tel" class="buy-count item_num hide" value="0" true="">
																			
													
													<!-- 从购物车加上 -->
													<a href="${pageContext.request.contextPath}/PlusServlet?gid=${li3.id}&path=<%=request.getRequestURL()%>&mid=<%=mid%>">
														<span class="buy-icon buy-plus js_add"></span>
													</a>
												</c:when>
												<c:otherwise> 
													<br><br>								
													<span>已经卖完</span>
												</c:otherwise>
											</c:choose>									
											
										</div>
														
									</div>
								 </div>
								</a>							
						</c:when>
						<c:otherwise> 
							<div class="vtab-item">
								商品已空，请您去看看其他类！
							</div>					
						</c:otherwise>
					</c:choose>
				</c:forEach>	
				</div>
			</div>
		</section>	
	
	</div>
		
</body>





</html>